package plus.decl;

import java.io.File;

import plus.Module;
import plus.Uni;
import plus.run.Loader;

public class D_Import {
	final String name;
	final String path;
	final boolean system;
	public D_Import(String path, String name, boolean system) {
		assert system == (path == null);
		this.path = path;
		this.name = name;
		this.system = system;
	}
	Module module;
	public void resolve(File __FILE__) {
		module = system ? Loader.beckonSystemModule(path) : Loader.beckonUserModule(__FILE__, path);
	}
	public void install() {
		if (null == name) Uni.installAnonymousModule(module);
		else Uni.installNamedModule(name, module);
	}
}
